package com.xqls.dal.service;

import com.xqls.dal.model.FlowRecord;
import com.xqls.dal.model.FlowRecordExample;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

public interface FlowRecordMapper {
	/**
	 * 批量添加流量记录到流量记录表中
	 * @param list
	 * @return
	 */
	int insertList(List<FlowRecord> list);
	
	int insertToMonth(Map<String,Object> map);
	
	int insertToDay(Map<String,Object> map);
	int deleteDay(Map<String,Object> map);
	int deleteMonth(Map<String,Object> map);
	
	/**
	 * 根据日期和设备编号查询出当日最大数据
	 * @param map
	 * @return
	 */
	Map<String, Object> selectDayMax(Map<String, Object> map);
	
	Map<String, Object> selectMonthMax(Map<String, Object> map);
	
	Map<String, Object> selectMaxBeforeThisByMap(Map<String, Object> map);
	
	Map<String,Object> selDayCumulativeFlow(Map<String,Object> map);
	/**
	 * 通过条件查询分钟记录
	 * @param map   日期和设备编号，所属模块编号
	 * @return
	 */
	List<Map<String, Object>> selectMinByMap(Map<String, Object> map);
	/**
	 * 通过条件查询小时记录
	 * @param map   日期和设备编号，所属模块编号
	 * @return
	 */
	List<Map<String, Object>> selectHourByMap(Map<String, Object> map);
	
	/**
	 * 通过条件查询日记录
	 * @param map   日期和设备编号，所属模块编号
	 * @return
	 */
	List<Map<String, Object>> selectDayByMap(Map<String, Object> map);
	/**
	 * 通过条件查询月统计
	 * @param map   日期和设备编号，所属模块编号
	 * @return
	 */
	List<Map<String, Object>> selectMonthByMap(Map<String, Object> map);
	/**
	 * 通过条件查询年统计
	 * @param map   日期和设备编号，所属模块编号
	 * @return
	 */
	List<Map<String, Object>> selectYearByMap(Map<String, Object> map);
	
	Map<String, Object> selectYearColumn(Map<String, Object> map);
	
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_record
     *
     * @mbggenerated
     */
    int countByExample(FlowRecordExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_record
     *
     * @mbggenerated
     */
    int deleteByExample(FlowRecordExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_record
     *
     * @mbggenerated
     */
    int deleteByPrimaryKey(Integer flowNo);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_record
     *
     * @mbggenerated
     */
    int insert(FlowRecord record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_record
     *
     * @mbggenerated
     */
    int insertSelective(FlowRecord record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_record
     *
     * @mbggenerated
     */
    List<FlowRecord> selectByExample(FlowRecordExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_record
     *
     * @mbggenerated
     */
    FlowRecord selectByPrimaryKey(Integer flowNo);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_record
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") FlowRecord record, @Param("example") FlowRecordExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_record
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") FlowRecord record, @Param("example") FlowRecordExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_record
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(FlowRecord record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table flow_record
     *
     * @mbggenerated
     */
    int updateByPrimaryKey(FlowRecord record);
    
    List<Map<String, Object>> getMinuteListByMap(Map<String, Object> map);
    
    List<Map<String, Object>> getHourListByMap(Map<String, Object> map);
    
    List<Map<String, Object>> getDayListByMap(Map<String, Object> map);
    
    List<Map<String, Object>> getMonthListByMap(Map<String, Object> map);
    
    List<Map<String, Object>> getYearListByMap(Map<String, Object> map);
    
    //根据设备编号和抄表时间查询取水量
    Map<String, Object> selflow(Map<String , Object> map);
    
}